﻿CREATE TABLE [Performance].[PerfDatabaseData] (
    [PerfDatabaseDataID]       INT           IDENTITY (1, 1) NOT NULL,
  
      [TimeID] INT NULL, 

    [PerfDatabaseID] INT NULL, 
    [num_of_reads] BIGINT NULL, 
    [num_of_writes] BIGINT NULL, 
    CONSTRAINT [PK_PerfDatabaseDataID] PRIMARY KEY CLUSTERED ([PerfDatabaseDataID] ASC), 
  
    CONSTRAINT [FK_PerfDatabaseData_Database] FOREIGN KEY ([PerfDatabaseID]) REFERENCES [Performance].[PerfDatabase]([PerfDatabaseID]),
    CONSTRAINT [FK_PerfDatabaseData_Time] FOREIGN KEY ([TimeID]) REFERENCES [Performance].[Time]([TimeID])
 
);


GO

CREATE INDEX [IX_PerfDatabaseData_TimeID_PerfDatabaseID] ON [Performance].[PerfDatabaseData] (TimeID,PerfDatabaseID)